//
//  NLPictureCell.swift
//  sinaWeibo7110
//
//  Created by 安静清晨 on 2017/1/10.
//  Copyright © 2017年 walk-in-minds. All rights reserved.
//

import UIKit

class NLPictureCell: UICollectionViewCell {

    
    lazy var iconView : UIImageView = UIImageView()
    
    var pic : NLPicture?{
        
        didSet{
            
            let url = URL(string: pic?.wap360 ?? "")
            iconView.sd_setImage(with: url)
            
            iconView.contentMode = UIViewContentMode.scaleAspectFill
            iconView.clipsToBounds = true
        }
        
    }
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    private func setupUI (){
        
        self.contentView.addSubview(iconView)
        
        iconView.snp.makeConstraints { (make) in
            
            make.edges.equalTo(self.contentView)
            
        }
    }
    
    
    
       
    
    
}
